<?php $this->load->view('layout/lottery/header') ?>
<div class="lotteryMain">

	<div class="panel panel-default">
		<div class="panel-heading">参与用户列表 LIST OF PARTICIPANTS IN DRAW</div>
		<div class="panel-body">
	  		<form class="form-horizontal form-search" method="get" action="<?php echo site_url('lottery/userParticipation'); ?>">
	  			<div class="clearfix form-text">
	  				<div class="form-group clearfix">
					    <label class="control-label">活动名称</label>
					    <select class="txt" name="lottery_id">
					    	<option value="0">全部</option>
					    	<?php if (isset($lottery)) : ?>
					    	<?php foreach($lottery as $value) : ?>
					    	<option value="<?php echo $value->lottery_id; ?>" <?php echo ($value->lottery_id == $this->input->get('lottery_id')) ? 'selected="selected"' : ''; ?>><?php echo $value->lottery_name; ?></option>
					    	<?php endforeach; ?>
					    <?php endif; ?>
					    </select>
					</div>
					<div class="form-group clearfix">
						<label class="control-label">参与用户</label>
						<input type="text" class="form-control txt" name="user_name" value="<?php echo $this->input->get('user_name'); ?>" placeholder="请输入参与用户账号">
					</div>
				</div>
				<div class="clearfix form-btns">
					<input type="submit" value="搜索" class="btn btn-submit" />
					<input type="reset" value="重置条件" class="btn btn-gray" />
				</div>
			</form>
		</div>
	</div>

	<div class="lotteryList">
		<?php if ($all_rows > 0) : ?>
		<table class="table table-striped mytable-striped">
			<thead>
				<tr>
					<th width="180">参与用户</th>
					<th width="140">抽奖日期</th>
					<th width="160">中奖次数</th>
					<th width="170">抽奖次数</th>
					<th>参与时间</th>
				</tr>
			</thead>
			<tbody>
				<?php foreach ($page_list->result() as $item) : ?>
				<tr>
					<td><?php echo mb_substr($item->user_name, 0, 1), '***', mb_substr($item->user_name, -1, 1); ?></td>
					<td><?php echo $item->date; ?></td>
					<td><?php echo $item->weight; ?></td>
					<td><?php echo ($item->today_total - $item->today_num); ?></td>
					<td><?php echo $item->created_at; ?></td>
				</tr>
				<?php endforeach; ?>
				</tr>
			</tbody>
		</table>
		<?php $this->load->view('layout/pagination') ?>
		<?php else :?>
            <div class="no-data">
                <img src="skins/images/panda.jpg"/>
                <p>没有搜索到结果</p>
            </div>
        <?php endif;?>
	</div>
</div>
<?php $this->load->view('layout/lottery/footer') ?>
<?php $this->load->view('layout/lottery/message') ?>